<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    434. Number of Segments in a String
   </h1>
   <p>
    Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.
   </p>
   <p>
    Please note that the string does not contain any
    <b>
     non-printable
    </b>
    characters.
   </p>
   <p>
    <b>
     Example:
    </b>
   </p>
   <pre>
<b>Input:</b> "Hello, my name is John"
<b>Output:</b> 5
</pre>
  </div>
  <div>
   <h1 class="question_title">
    434. 字符串中的单词数
   </h1>
   <p>
    统计字符串中的单词个数，这里的单词指的是连续的不是空格的字符。
   </p>
   <p>
    请注意，你可以假定字符串里不包括任何不可打印的字符。
   </p>
   <p>
    <strong>
     示例:
    </strong>
   </p>
   <pre><strong>输入:</strong> "Hello, my name is John"
<strong>输出:</strong> 5
</pre>
  </div>
 </body>
</html>